import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
import {Provider} from 'react-redux'
import {MainStore} from './configs/MainStore'
import {LocaleProvider} from 'antd';
import {seiLocale} from 'sei-utils';
import './App.css';
import moment from 'moment';

const {getLocales, seiIntl, getLocale} = seiLocale;

function initLocalLocals(localPath) {
  const locale = getLocale();
  const locales = getLocales();
  seiIntl.init({
    currentLocale: locales.locale,
    locales: {
      [locale]: require(`${localPath}/${locales.locale}`)
    }
  });
}

initLocalLocals('./locales');
const locale = getLocales();
locale.momentLocale && moment.locale(locale.momentLocale);

ReactDOM.render(
  <LocaleProvider locale={locale.antd}>
    <Provider store={MainStore}>
      <App/>
    </Provider>
  </LocaleProvider>,
  document.getElementById('root'));
registerServiceWorker();
